package com.shenzhen.group.niuniu.controller;

import com.shenzhen.group.common.card.Card;
import com.shenzhen.group.common.game.Position;
import com.shenzhen.group.common.player.Player;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author: wp
 * @date: 2023/4/3 18:56:18
 * @desc:
 **/
public class GameContext {

    public static ThreadLocal<List<Player>> playerContext = new ThreadLocal<>();
    public static ThreadLocal<List<Position>> positionContext = new ThreadLocal<>();
    public static ThreadLocal<Player> dealContext = new ThreadLocal<>();
    public static ThreadLocal<Map<Long, String>> detContext = new ThreadLocal<>();

    public static ThreadLocal<List<Player>> getPlayerContext() {
        return playerContext;
    }

    public static ThreadLocal<List<Position>> getPositionContext() {
        return positionContext;
    }

    public static ThreadLocal<Player> getDealContext() {
        return dealContext;
    }

    public static ThreadLocal<Map<Long, String>> getDetContext(){
        return detContext;
    }

    public static void remove() {
        playerContext.remove();
        dealContext.remove();
        positionContext.remove();
        dealContext.remove();
    }
}
